const loginPage = [
  {
    path: '/login',
    name: 'login',
    component: () =>
      import(/* webpackChunkName: "Login" */ '../pages/login/Login'),
  },
];

const registerPage = [
  {
    path: '/register',
    name: 'register',
    component: () => import('../pages/login/Register'),
  },
];

const editpage = [
  {
    path: '/edit',
    name: 'edit',
    component: () =>
      import(/* webpackChunkName: "Edit" */ '../pages/edit/Edit'),
  },
];

const mainPage = [
  {
    path: '/',
    redirect: '/main',
  },
  {
    path: '/main',
    name: 'main',
    component: () =>
      import(/* webpackChunkName: "Main" */ '../pages/main/Main'),
    children: [
      {
        path: 'first',
        name: 'first',
        component: () =>
          import(
            /* webpackChunkName: "Second" */ '../pages/main/routes/first/First'
          ),
      },
      {
        path: 'second/second',
        name: 'second',
        component: () =>
          import(
            /* webpackChunkName: "First" */ '../pages/main/routes/second/Second'
          ),
      },
      {
        path: 'user',
        name: 'user',
        component: () =>
          import(
            /* webpackChunkName: "UserManage" */ '../pages/main/routes/user-manage/UserManage'
          ),
      },
      {
        path: 'userinfo',
        name: 'userinfo',
        component: () =>
          import(
            /* webpackChunkName: "UserInfo" */ '../pages/main/routes/user-manage/UserInfo'
          ),
      },
      {
        path: 'user',
        name: 'user',
        component: () =>
          import(
            /* webpackChunkName: "UserManage" */ '../pages/main/routes/user-manage/UserManage'
          ),
      },
      {
        path: 'userinfo',
        name: 'userinfo',
        component: () =>
          import(
            /* webpackChunkName: "UserInfo" */ '../pages/main/routes/user-manage/UserInfo'
          ),
      },
      {
        path: 'edit',
        name: 'edit',
        component: () =>
          import(
            /* webpackChunkName: "Third" */ '../pages/main/routes/edit/Edit'
          ),
      },
      {
        path: 'edit/:id',
        name: 'editArticle',
        component: () =>
          import(
            /* webpackChunkName: "Third" */ '../pages/main/routes/edit/Edit'
          ),
      },

      {
        path: 'articles',
        name: 'articles',
        component: () =>
          import(
            /* webpackChunkName: "Third" */ '../pages/main/routes/articles/ArticleList'
          ),
      },
      {
        path: 'articles/:id',
        name: 'ArticleDetails',
        component: () => import('../pages/main/routes/articles/Article'),
      },

      {
        path: 'review',
        name: 'review',
        component: () => import('../pages/main/routes/review/Review.vue'),
        children: [
          {
            path: 'overview',
            name: 'overview',
            component: () => import('../pages/main/routes/review/Overview.vue'),
          },
          {
            path: 'workbench',
            name: 'workbench',
            component: () =>
              import('../pages/main/routes/review/Workbench.vue'),
          },
          {
            path: 'reviewList',
            name: 'reviewList',
            component: () =>
              import('../pages/main/routes/review/ReviewList.vue'),
          },
        ],
      },
      {
        path: 'mail',
        name: 'mail',
        component: () =>
          import(
            /* webpackChunkName: "Mail" */ '../pages/main/routes/mail/Mail'
          ),
      },
    ],
  },
];

const errorPage = [
  {
    path: '/notFound',
    name: 'notFound',
    component: () =>
      import(/* webpackChunkName: "NotFound" */ '../pages/error/NotFound'),
  },
  {
    path: '/forbidden',
    name: 'forbidden',
    component: () =>
      import(/* webpackChunkName: "Forbidden" */ '../pages/error/Forbidden'),
  },
  {
    path: '/badGateway',
    name: 'badGateway',
    component: () =>
      import(/* webpackChunkName: "BadGateway" */ '../pages/error/BadGateway'),
  },
  {
    path: '*',
    redirect: '/notFound',
  },
];
export default [
  ...loginPage,
  ...mainPage,
  ...errorPage,
  ...editpage,
  ...registerPage,
];
